//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#if _MSC_VER > 1000
#pragma once
#endif

#if !defined(__CSOCKETSERVICE_H__)
#define __CSOCKETSERVICE_H__

#define _NO_CSOCKETSERVICE_CLASSOBJECT_
#include "_CSocketService.h"
#include <elatypes.h>
#include <car.h>
//#include <sys/netmisc.h>

class CSocketService : public _CSocketService
{
public:
    CARAPI_(UInt32) AddRef();
    CARAPI_(UInt32) Release();
    CSocketService():m_cRef(0) {}
    CARAPI constructor();

    CARAPI CreateSocket(
        /* [in] */ Int32 family,
        /* [in] */ Int32 type,
        /* [in] */ Int32 protocol,
        /* [out] */ ISocket * * ppNewSocket,
        /* [out] */ Int32 *pError);

    CARAPI WaitForSockets(
        /* [in] */ const SocketTime & timeout,
        /* [in] */ const BufferOf<IInterface*> & sockets,
        /* [in] */ const MemoryBuf & eventRequests,
        /* [out] */ MemoryBuf * pEventResponses,
        /* [out] */ Int32 *pError);

    CARAPI GetIPAddresses(
        /* [out] */ IPv4Address *ipAddr,
        /* [out] */ IPv4Address *netmask,
        /* [out] */ IPv4Address *gateway,
        /* [out] */ IPv4Address *dns1,
        /* [out] */ IPv4Address *dns2);


private:
    Int32 m_cRef;
};

#endif //!(__CSOCKETSERVICE_H__)

